home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-22 | 1.3 KB | 70 lines | [TEXT/BROW] |
- // Transmitter.h
- // Created by Bill Hubauer on Fri, Jun 16, 1995 @ 7:27 AM.
-
- #ifndef __Transmitter__
- #define __Transmitter__
-
- #ifndef __MessageObjects__
- #include "MessageObjects.h"
- #endif
-
- #ifndef __SSTYPES__
- #include "SSTypes.h"
- #endif
-
- #ifndef __SoundSource__
- #include "SoundSource.h"
- #endif
-
- #ifndef __Semaphore__
- #include "Semaphore.h"
- #endif
-
-
-
- class STransmitter : public MMessageReceiver
- {
- public:
- STransmitter(SSWriteProcPtr writeProc,long writeProcRefCon,SSQuality quality);
- virtual ~STransmitter();
-
- OSErr Initialize();
-
-
- OSErr SetSource(SSoundSourceRef newSource);
- SSoundSourceRef GetSource() {return _curSource;}
- void SetActive(Boolean activeQ);
- Boolean ActiveQ() {return _activeQ;}
- void Reset() {_curSource->Reset();}
-
-
- virtual void ReceiveMessage(UInt32 message,void* param,MMessageSender* from);
-
- private:
- void KillWriteBuffer();
- void WaitForWriteToComplete();
- OSErr MakeNewWriteBuffer();
-
- void StartWrite();
-
- void CompleteWrite(OSErr ioResult);
- static pascal void WriteCompletion(long completionData,OSErr ioResult,long ioLength);
-
-
- SSoundSourceRef _curSource;
- Boolean _activeQ;
- Boolean _priming;
-
- Ptr _writeBuffer;
- UInt32 _bufferSize;
-
- SSWriteProcPtr _writeProc;
- long _writeProcRefCon;
- SSQuality _quality;
-
- CSemaphore _writeFlag;
- OSErr _sourceError;
- };
-
- #endif
-